package day14.CountDownLatchDemo01;

import java.util.concurrent.CountDownLatch;

/**
 * @author Xiao
 * @date 2021/8/8
 */
public class ChildThread3 implements Runnable {
    private CountDownLatch cd;

    public ChildThread3(CountDownLatch cd) {
        this.cd = cd;
    }

    @Override
    public void run() {
        for (int i = 1; i <= 15; i++) {
            System.out.println(Thread.currentThread().getName()
                    + "在吃第" + i + "个饺子。。。");
        }
        System.out.println(Thread.currentThread().getName() + "吃完了。。。");
        cd.countDown();
    }
}
